package com.ustc.phoenix.controller;

import com.ustc.phoenix.logic.UserManagementLogic;
import com.ustc.phoenix.models.User;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by firephoenix on 5/26/16.
 */
@RestController
@RequestMapping(value="/user")
public class UserController {
    /*@Autowired
    HashMap<String,String> tokenmap ;
    @Autowired
    UserManagementLogic userManagementLogic;
    */
    @RequestMapping(method = RequestMethod.GET)
    public List<User> getUser(@RequestParam("name") String name,
                              @RequestHeader String token,
                              @RequestHeader String admin){

      //  if(tokenmap.get(admin)){}
        User query=new User();
        query.setName(name);
        UserManagementLogic userManagementLogic=new UserManagementLogic();

        return userManagementLogic.getUsers(query);
    }
}
